import { Inject, Controller, Post, Body } from '@midwayjs/decorator';
import { Context } from '@midwayjs/koa'
import { WxService } from '../service/wx.service';

/**
 * 描述
 */
@Controller('/wx')
export class APIController {
  @Inject()
  ctx: Context;

  @Inject()
  wxlogin: WxService

  @Post('/login')
  async login(@Body() body) {
    return this.wxlogin.login(body)

  }
  @Post('/getiphone')
  async getiphone(@Body() body) {
    return this.wxlogin.getiphone(body)

  }
  @Post('/getiphonev2')
  async getiphonev2(@Body() body) {
    return this.wxlogin.getiphonev2(body)

  }
  @Post('/pay')
  async pay(@Body() body) {
    return this.wxlogin.pay(body)

  }
  @Post('/payv2')
  async payv2(@Body() body) {
    return this.wxlogin.payv2()

  }
  @Post('/payv3')
  async payv3(@Body() body) {
    return this.wxlogin.payv3()

  }
  @Post('/pay24')
  async pay24(@Body() body) {
    return this.wxlogin.pay24()

  }

  
  @Post('/refund')
  async refund(@Body() body) {
    return this.wxlogin.refunds(body.orderSn, body.num)

  }

  

  @Post('/sendmsg')
  async sendmsg(@Body() body) {
    return this.wxlogin.sendmsg()

  }
  @Post('/send40004')
  async send40004(@Body() body) {
    return this.wxlogin.send40004()

  }
}